package com.ghy.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author GaoHeYang
 */
@Configuration
public class SpringDocConfig {
    private final String AUTHOR = "ghy";
    private final String URL = "http://localhost:5400";
    private final String TITLE = "ml-sale";
    private final String DESCRIPTION = "<em>MyLesson － 课程微服务</em>";
    private final String VERSION = "v1.0.0";

    /**通用信息Bean */
    @Bean
    public OpenAPI commonInfo() {
        return new OpenAPI().info(new Info()
                .title(TITLE)
                .description(DESCRIPTION)
                . version(VERSION)
                .contact(new Contact().name(AUTHOR).url(URL)));
    }
}
